Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split phase change from MirPass #102340

Merged
merged 1 commit into from
Oct 25, 2022

Conversation

JakobDegen
Copy link
Contributor

The main goal here is to simplify the pass manager logic. MirPass no longer contains the phase_change method, and run_passes instead accepts an Option<PhaseChange>. The hope is that this addresses the comments (and maybe perf regression) from #99102 .

r? @oli-obk cc @RalfJung

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 27, 2022
@rustbot
Copy link
Collaborator

rustbot commented Sep 27, 2022

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 27, 2022
@JakobDegen
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 27, 2022
@bors
Copy link
Contributor

bors commented Sep 27, 2022

⌛ Trying commit b6bd3d8deae8ab0c97efacc73a53a932608d1c78 with merge 91f1e60cacbc612e315bf021ed4cf3dbd485dfcc...

@bors
Copy link
Contributor

bors commented Sep 27, 2022

☀️ Try build successful - checks-actions
Build commit: 91f1e60cacbc612e315bf021ed4cf3dbd485dfcc (91f1e60cacbc612e315bf021ed4cf3dbd485dfcc)

@rust-timer
Copy link
Collaborator

Queued 91f1e60cacbc612e315bf021ed4cf3dbd485dfcc with parent de0b511, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (91f1e60cacbc612e315bf021ed4cf3dbd485dfcc): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 1
Improvements ✅
(secondary)
-0.3% [-0.4%, -0.3%] 4
All ❌✅ (primary) -0.2% [-0.2%, -0.2%] 1

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.0% [-6.8%, -3.1%] 2
All ❌✅ (primary) - - 0

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.4% [-5.3%, -3.3%] 3
All ❌✅ (primary) - - 0

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 27, 2022
@@ -292,6 +319,7 @@ impl<'tcx> Body<'tcx> {

let mut body = Body {
phase: MirPhase::Built,
pass_count: 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks like pretty fragile initialization. Is this always 1 initially?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is a counter that is always set/reset to 1 everywhere.

@JakobDegen
Copy link
Contributor Author

The revert is entirely a shot in the dark for getting the perf from #99102 back, but let's see (waiting on CI before queuing)

@JakobDegen
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 28, 2022
@bors
Copy link
Contributor

bors commented Sep 28, 2022

⌛ Trying commit 43ea3c1d6b34a9d562c2d72e3497c1c1e73ef65e with merge 43ae51f3bc0705a23cc4c354a410097b33a2ef65...

@bors
Copy link
Contributor

bors commented Sep 28, 2022

☀️ Try build successful - checks-actions
Build commit: 43ae51f3bc0705a23cc4c354a410097b33a2ef65 (43ae51f3bc0705a23cc4c354a410097b33a2ef65)

@rust-timer
Copy link
Collaborator

Queued 43ae51f3bc0705a23cc4c354a410097b33a2ef65 with parent d6734be, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (43ae51f3bc0705a23cc4c354a410097b33a2ef65): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
0.7% [0.7%, 0.7%] 1
Regressions ❌
(secondary)
1.3% [1.2%, 1.5%] 6
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 1
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 3
All ❌✅ (primary) 0.2% [-0.2%, 0.7%] 2

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
7.1% [7.1%, 7.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
8.1% [8.1%, 8.1%] 1
Regressions ❌
(secondary)
5.9% [5.9%, 5.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-3.2%, -2.9%] 2
All ❌✅ (primary) 8.1% [8.1%, 8.1%] 1

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 28, 2022
@JakobDegen
Copy link
Contributor Author

I've dropped the last commit (which turned out to not give back any perf benefits). I'll keep looking into fixing the perf regression from the other PR, but in the meantime I think we should probably merge this, since it's an improvement on its own.

@oli-obk
Copy link
Contributor

oli-obk commented Oct 24, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Oct 24, 2022

📌 Commit be2401b has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 24, 2022
@bors
Copy link
Contributor

bors commented Oct 24, 2022

⌛ Testing commit be2401b with merge 051edf415cb5a12984d6976d7df4f50ed60e0bea...

@bors
Copy link
Contributor

bors commented Oct 25, 2022

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 25, 2022
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@JakobDegen
Copy link
Contributor Author

Was the failure spurious? How do I tell?

@oli-obk
Copy link
Contributor

oli-obk commented Oct 25, 2022

@bors retry timeout

Probably just an arbitrary spurious CI failure

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 25, 2022
@bors
Copy link
Contributor

bors commented Oct 25, 2022

⌛ Testing commit be2401b with merge bed4ad6...

@bors
Copy link
Contributor

bors commented Oct 25, 2022

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing bed4ad6 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 25, 2022
@bors bors merged commit bed4ad6 into rust-lang:master Oct 25, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 25, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (bed4ad6): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.1% [1.1%, 1.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.5% [-1.3%, -0.2%] 4
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
9.9% [2.3%, 20.0%] 22
Regressions ❌
(secondary)
3.5% [3.2%, 3.8%] 2
Improvements ✅
(primary)
-6.1% [-6.6%, -5.2%] 4
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 7.5% [-6.6%, 20.0%] 26

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
10.5% [0.9%, 41.9%] 95
Regressions ❌
(secondary)
6.1% [1.2%, 15.0%] 36
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.2% [-3.2%, -3.2%] 1
All ❌✅ (primary) 10.5% [0.9%, 41.9%] 95

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot removed the perf-regression Performance regression. label Oct 25, 2022
@Mark-Simulacrum
Copy link
Member

FYI using this commit to get a SMT + Turbo vs. non-SMT and non-Turbo comparison on the perf machine, expecting another post here as a result. See discussion here https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/Disabling.20hyperthreading.2Fturbo/near/306100379

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (bed4ad6): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.5% [-1.3%, -0.2%] 4
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.2% [4.2%, 4.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.7% [-3.7%, -3.7%] 1
All ❌✅ (primary) - - 0

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.4% [-3.8%, -1.4%] 37
Improvements ✅
(secondary)
-2.8% [-3.4%, -2.1%] 17
All ❌✅ (primary) -2.4% [-3.8%, -1.4%] 37

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@JakobDegen JakobDegen deleted the pass-manager-simplification branch October 27, 2022 00:00
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
…on, r=oli-obk

Split phase change from `MirPass`

The main goal here is to simplify the pass manager logic. `MirPass` no longer contains the `phase_change` method, and `run_passes` instead accepts an `Option<PhaseChange>`. The hope is that this addresses the comments (and maybe perf regression) from rust-lang#99102 .

r? `@oli-obk` cc `@RalfJung`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants